package com.cskaoyan.bean.po;

import lombok.Data;

/**
 * @ClassName:HandleOption
 * @Auther: HeXianZu
 * @Description:
 * @Date: 2022/10/13 22:43
 */
@Data
public class HandleOption {

    private Boolean cancel;
    private Boolean delete;
    private Boolean pay;
    private Boolean comment;
    private Boolean confirm;
    private Boolean refund;
    private Boolean rebuy;
    private Boolean aftersale;

    // 101待付款、201已付款、301已发货、401用户收货
    // 102用户取消、103系统取消、202申请退款、203已退款、402系统收货
    public void setHandleOption(Short orderStatus){
        if (orderStatus==101){
            cancel = true;
            delete = false;
            pay = true;
            comment = false;
            confirm = false;
            refund = false;
            rebuy = false;
            aftersale = false;
        }
        if (orderStatus==201){
            cancel = false;
            delete = false;
            pay = false;
            comment = false;
            confirm = false;
            refund = true;
            rebuy = false;
            aftersale = false;
        }
        if (orderStatus==301){
            cancel = false;
            delete = false;
            pay = false;
            comment = false;
            confirm = true;
            refund = false;
            rebuy = false;
            aftersale = false;
        }
        if (orderStatus==401){
            cancel = false;
            delete = true;
            pay = false;
            comment = true;
            confirm = false;
            refund = false;
            rebuy = true;
            aftersale = true;
        }

    }
}
